class Teacher():
    def __init__(self, name,age):
        self.__name=name
        self.__age=age
    def __str__(self):
        return self.__name+" "+str(self.__age)

    def __teach(self):
        print("教学")
    @property
    def age(self):
        return self.__age


    @age.setter
    def age(self,age):
        if age < 0:
            raise Exception('age cannot lt zero')
        else:
            self.__age=age

zs = Teacher("zs",30)
# zs.set_age(-20)
print(zs.age)
# zs.age = -20
print(zs.__dict__)
zs._Teacher__age=-20
print(zs._Teacher__age)
# print(zs)
